﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             x:Class="SilverlightPlayground.LightBox.App"
             xmlns:local="clr-namespace:SilverlightPlayground.LightBox">
    
    <Application.ApplicationLifetimeObjects>        
        <local:SlideShowCoordinator />
    </Application.ApplicationLifetimeObjects>
    
    <Application.Resources>
        <ControlTemplate x:Key="NextButtonTemplate" TargetType="Button">
            <Grid x:Name="grid" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Pressed">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid" />
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Focused"/>
                        <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Path Data="M104.5,31.5 L56,3 L55,59 z" Fill="{TemplateBinding Background}" Stretch="Fill" UseLayoutRounding="False" HorizontalAlignment="Center" Width="48" Height="56" VerticalAlignment="Center" Margin="14,0,0,0"/>
                <Path x:Name="path" Data="M104.5,31.5 L56,3 L55,59 z" Fill="{TemplateBinding Foreground}" Stretch="Fill" UseLayoutRounding="False" HorizontalAlignment="Center" Width="48" Height="56" VerticalAlignment="Center" Margin="14,0,0,0" Opacity="0" Cursor="Hand"/>
                <Ellipse x:Name="ellipse" Height="100" VerticalAlignment="Center" Margin="0" StrokeThickness="10" Stroke="{TemplateBinding BorderBrush}"/>
            </Grid>
        </ControlTemplate>

        <ControlTemplate x:Key="PrevButtonTemplate" TargetType="Button">
            <Grid x:Name="grid" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Pressed">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid" />
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Focused"/>
                        <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Path Data="M8,31.5 L56,3 L55,59 z" Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Stretch="Fill" Width="48" UseLayoutRounding="False" Height="56" VerticalAlignment="Center" Margin="0,0,14,0"/>
                <Path x:Name="path" Data="M8,31.5 L56,3 L55,59 z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" Stretch="Fill" Width="48" UseLayoutRounding="False" Height="56" VerticalAlignment="Center" Margin="0,0,14,0" Opacity="0" Cursor="Hand"/>
                <Ellipse x:Name="ellipse" Height="100" VerticalAlignment="Center" Margin="0" StrokeThickness="10" Stroke="{TemplateBinding BorderBrush}"/>
            </Grid>
        </ControlTemplate>
    </Application.Resources>
    
</Application>
